cmake_minimum_required(VERSION 3.0)
project(leetcode_cpp)

add_subdirectory(temp)
add_subdirectory(src/test)

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED True)

include_directories(
        ${PROJECT_SOURCE_DIR}
        ${PROJECT_SOURCE_DIR}/utils
        ${PROJECT_SOURCE_DIR}/stage1
)

# stage1
add_executable(leetcode_cpp src/stage1/main.cpp)

# stage2
add_executable(solution029 src/stage2/solution029.cpp)
add_executable(solution030 src/stage2/solution030.cpp)
add_executable(solution031 src/stage2/solution031.cpp)

# stage3
add_executable(111 src/stage3/breadth_first_search/111_MinimumDepthOfBinaryTree.cpp)
add_executable(752 src/stage3/breadth_first_search/752_OpenTheLock.cpp)
add_executable(051 src/stage3/depth_first_search/051_NQueens.cpp)
add_executable(509 src/stage3/dynamic_programming/509_FibonacciNumber.cpp)
add_executable(322 src/stage3/dynamic_programming/322_CoinChang.cpp)
add_executable(121 src/stage3/dynamic_programming/121_BestTimeToBuyAndSellStock.cpp)
add_executable(015 src/stage3/array/015_3Sum.cpp)
add_executable(018 src/stage3/array/018_4Sum.cpp)
add_executable(303 src/stage3/array/303_RangeSumQuery-Immutable.cpp)
add_executable(304 src/stage3/array/304_RangeSumQuery2D-Immutable.cpp)
add_executable(560 src/stage3/array/560_SubarraySumEqualsK.cpp)
add_executable(1109 src/stage3/array/1109_CorporateFlightBookings.cpp)
add_executable(1094 src/stage3/array/1094_CarPooling.cpp)
add_executable(048 src/stage3/array/048_RotateImage.cpp)
add_executable(054 src/stage3/array/054_SpiralMatrix.cpp)
add_executable(059 src/stage3/array/059_SpiralMatrixII.cpp)
add_executable(528 src/stage3/array/528_RandomPickWithWeight.cpp)
add_executable(704 src/stage3/binary_search/704_BinarySearch.cpp)
add_executable(034 src/stage3/binary_search/034_FindFirstAndLastPositionOfElementInSortedArray.cpp)
add_executable(104 src/stage3/binary_tree/104_MaximumDepthOfBinaryTree.cpp)
add_executable(543 src/stage3/binary_tree/543_DiameterOfBinaryTree.cpp)
add_executable(144 src/stage3/binary_tree/144_BinaryTreePreorderTraversal.cpp)
add_executable(669 src/stage3/binary_tree/669_TrimABinarySearchTree.cpp)
add_executable(124 src/stage3/binary_tree/124_BinaryTreeMaximumPathSum.cpp)
add_executable(515 src/stage3/binary_tree/515_FindLargestValueInEachTreeRow.cpp)
add_executable(1038 src/stage3/binary_tree/1038_BinarySearchTreetoGreaterSumTree.cpp)
add_executable(538 src/stage3/binary_tree/538_ConvertBSTtoGreaterTree.cpp)
add_executable(226 src/stage3/binary_tree/226_InvertBinaryTree.cpp)
add_executable(116 src/stage3/binary_tree/116_PopulatingNextRightPointersinEachNode.cpp)
add_executable(114 src/stage3/binary_tree/114_FlattenBinaryTreetoLinkedList.cpp)
add_executable(654 src/stage3/binary_tree/654_MaximumBinaryTree.cpp)
add_executable(105 src/stage3/binary_tree/105_BinaryTreefromPreorderandInorderTraversal.cpp)
add_executable(106 src/stage3/binary_tree/106_ConstructBinaryTreeFromInorderAndPostorderTraversal.cpp)
add_executable(889 src/stage3/binary_tree/889_ConstructBinaryTreeFromPreorderAndPostorderTraversal.cpp)
add_executable(652 src/stage3/binary_tree/652_FindDuplicateSubtrees.cpp)
add_executable(297 src/stage3/binary_tree/297_SerializeAndDeserializeBinaryTree.cpp)
add_executable(122 src/stage3/dynamic_programming/122_BestTimeToBuyAndSellStockII.cpp)
add_executable(123 src/stage3/dynamic_programming/123_BestTimeToBuyAndSellStockIII.cpp)
add_executable(188 src/stage3/dynamic_programming/188_BestTimeToBuyAndSellStockIV.cpp)
add_executable(309 src/stage3/dynamic_programming/309_BestTimeToBuyAndSellStockWithCooldown.cpp)
add_executable(714 src/stage3/dynamic_programming/714_BestTimeToBuyAndSellStockWithTransactionFee.cpp)
add_executable(198 src/stage3/dynamic_programming/198_HouseRobber.cpp)
add_executable(213 src/stage3/dynamic_programming/213_HouseRobberII.cpp)
add_executable(337 src/stage3/dynamic_programming/337_HouseRobberIII.cpp)
add_executable(300 src/stage3/dynamic_programming/300_LongestIncreasingSubsequence.cpp)
add_executable(354 src/stage3/dynamic_programming/354_RussianDollEnvelopes.cpp)
add_executable(931 src/stage3/dynamic_programming/931_MinimumFallingPathSum.cpp)
add_executable(494 src/stage3/dynamic_programming/494_Target_Sum.cpp)
add_executable(416 src/stage3/dynamic_programming/416_PartitionEqualSubsetSum.cpp)
add_executable(072 src/stage3/dynamic_programming/072_EditDistance.cpp)
add_executable(053 src/stage3/dynamic_programming/053_MaximumSubarray.cpp)
add_executable(518 src/stage3/dynamic_programming/518_CoinChange2.cpp)
add_executable(1143 src/stage3/dynamic_programming/1143_LongestCommonSubsequence.cpp)
add_executable(583 src/stage3/dynamic_programming/583_DeleteOperationForTwoStrings.cpp)
add_executable(712 src/stage3/dynamic_programming/712_MinimumASCIIDeleteSumForTwoStrings.cpp)
add_executable(042 src/stage3/dynamic_programming/042_TrappingRainWater.cpp)
add_executable(516 src/stage3/dynamic_programming/516_LongestPalindromicSubsequence.cpp)
add_executable(005 src/stage3/dynamic_programming/005_LongestPalindromicSubstring.cpp)
add_executable(323 src/stage3/graph/323_NumberOfConnectedComponentsInAnUndirectedGraph.cpp)
add_executable(130 src/stage3/graph/130_SurroundedRegions.cpp)
add_executable(886 src/stage3/graph/886_PossibleBipartition.cpp)
add_executable(990 src/stage3/graph/990_SatisfiabilityOfEqualityEquations.cpp)
add_executable(023 src/stage3/linked_lists/023_MergeKSortedLists.cpp)
add_executable(019 src/stage3/linked_lists/019_RemoveNthNodeFromEndOfList.cpp)
add_executable(876 src/stage3/linked_lists/876_MiddleOfTheLinkedList.cpp)
add_executable(141 src/stage3/linked_lists/141_LinkedListCycle.cpp)
add_executable(142 src/stage3/linked_lists/142_LinkedListCycleII.cpp)
add_executable(160 src/stage3/linked_lists/160_IntersectionOfTwoLinkedLists.cpp)
add_executable(025 src/stage3/linked_lists/025_ReverseNodesInK-Group.cpp)
add_executable(206 src/stage3/linked_lists/206_ReverseLinkedList.cpp)
add_executable(092 src/stage3/linked_lists/092_ReverseLinkedListII.cpp)
add_executable(234 src/stage3/linked_lists/234_PalindromeLinkedList.cpp)
add_executable(086 src/stage3/linked_lists/086_PartitionList.cpp)
add_executable(149 src/stage3/other/149_MaxPointsOnALine.cpp)
add_executable(078 src/stage3/permutation/078_Subsets.cpp)
add_executable(077 src/stage3/permutation/077_Combinations.cpp)
add_executable(046 src/stage3/permutation/046_Permutations.cpp)
add_executable(090 src/stage3/permutation/090_Subsets-2.cpp)
add_executable(040 src/stage3/permutation/040_CombinationSum-2.cpp)
add_executable(047 src/stage3/permutation/047_Permutations-2.cpp)
add_executable(039 src/stage3/permutation/039_CombinationSum.cpp)
add_executable(216 src/stage3/permutation/216_CombinationSum-3.cpp)
add_executable(003 src/stage3/string/003_LongestSubstringWithoutRepeatingCharacters.cpp)
add_executable(076 src/stage3/string/076_MinimumWindowSubstring.cpp)
add_executable(567 src/stage3/string/567_PermutationInString.cpp)
add_executable(438 src/stage3/string/438_FindAllAnagramsInAString.cpp)
add_executable(912 src/stage3/sort/912_SortAnArray.cpp)
add_executable(315 src/stage3/sort/315_CountOfSmallerNumbersAfterSelf.cpp)
add_executable(493 src/stage3/sort/493_ReversePairs.cpp)
add_executable(327 src/stage3/sort/327_CountOfRangeSum.cpp)
add_executable(215 src/stage3/sort/215_KthLargestElementInAnArray.cpp)

# offer
add_executable(offer04 src/offer/offer04.cpp)
add_executable(1312 src/stage3/dynamic_programming/1312_MinimumInsertionStepsToMakeAStringPalindrome.cpp)
add_executable(064 src/stage3/dynamic_programming/064_MinimumPathSum.cpp)
add_executable(174 src/stage3/dynamic_programming/174_DungeonGame.cpp)
add_executable(514 src/stage3/dynamic_programming/514_FreedomTrail.cpp)
add_executable(787 src/stage3/dynamic_programming/787_CheapestFlightsWithinKStops.cpp)
add_executable(010 src/stage3/dynamic_programming/010_RegularExpressionMatching.cpp)
add_executable(200 src/stage3/graph/200_NumberOfIslands.cpp)
add_executable(1254 src/stage3/graph/1254_NumberOfClosedIslands.cpp)
add_executable(1020 src/stage3/graph/1020_NumberOfEnclaves.cpp)
add_executable(695 src/stage3/graph/695_MaxAreaOfIsland.cpp)
add_executable(1905 src/stage3/graph/1905_CountSubIslands.cpp)
add_executable(694 src/stage3/graph/694_NumberOfDistinctIslands.cpp)
add_executable(797 src/stage3/graph/797_AllPathsFromSourceToTarget.cpp)
add_executable(207 src/stage3/graph/207_CourseSchedule.cpp)
add_executable(210 src/stage3/graph/210_CourseScheduleII.cpp)
add_executable(785 src/stage3/graph/785_IsGraphBipartite.cpp)
add_executable(offer03 src/offer/offer03.cpp)
add_executable(offer05 src/offer/offer05.cpp)
add_executable(offer06 src/offer/offer06.cpp)
add_executable(offer09 src/offer/offer09.cpp)
add_executable(offer10-1 src/offer/offer10-1.cpp)
add_executable(offer10-2 src/offer/offer10-2.cpp)
add_executable(offer11 src/offer/offer11.cpp)
add_executable(offer12 src/offer/offer12.cpp)
add_executable(offer18 src/offer/offer18.cpp)
add_executable(offer21 src/offer/offer21.cpp)
add_executable(offer22 src/offer/offer22.cpp)
add_executable(offer24 src/offer/offer24.cpp)
add_executable(offer25 src/offer/offer25.cpp)
add_executable(offer26 src/offer/offer26.cpp)
add_executable(offer27 src/offer/offer27.cpp)
add_executable(offer28 src/offer/offer28.cpp)
add_executable(offer30 src/offer/offer30.cpp)
add_executable(offer32-1 src/offer/offer32-1.cpp)
add_executable(offer32-2 src/offer/offer32-2.cpp)
add_executable(offer32-3 src/offer/offer32-3.cpp)
add_executable(offer35 src/offer/offer35.cpp)
add_executable(offer42 src/offer/offer42.cpp)
add_executable(offer46 src/offer/offer46.cpp)
add_executable(offer47 src/offer/offer47.cpp)
add_executable(offer48 src/offer/offer48.cpp)
add_executable(offer50 src/offer/offer50.cpp)
add_executable(offer52 src/offer/offer52.cpp)
add_executable(offer53-1 src/offer/offer53-1.cpp)
add_executable(offer53-2 src/offer/offer53-2.cpp)
add_executable(offer57 src/offer/offer57.cpp)
add_executable(offer58-1 src/offer/offer58-1.cpp)
add_executable(offer58-2 src/offer/offer58-2.cpp)
add_executable(offer63 src/offer/offer63.cpp)

# nowcoder
# offer
add_executable(JZ3 src/nowcoder/offer/array/JZ3_FindDuplicateNumber.cpp)
add_executable(JZ40 src/nowcoder/offer/array/JZ40_MinKNumbersInAnArray.cpp)
add_executable(JZ41 src/nowcoder/offer/array/JZ41_GetMedianFromStream.cpp)
add_executable(JZ51 src/nowcoder/offer/array/JZ51_InversePairsInAnArray.cpp)
add_executable(JZ53 src/nowcoder/offer/array/JZ53_ElementOccurrenceNumberInSortedArray.cpp)
add_executable(JZ10 src/nowcoder/offer/dynamic_programming/JZ10_Fibonacci.cpp)
add_executable(JZ19 src/nowcoder/offer/dynamic_programming/JZ19_RegexMatch.cpp)
add_executable(JZ69 src/nowcoder/offer/dynamic_programming/JZ69_JumpFloor.cpp)
add_executable(JZ42 src/nowcoder/offer/dynamic_programming/JZ42_FindGreatSumOfSubArray.cpp)
add_executable(JZ46 src/nowcoder/offer/dynamic_programming/JZ46_TranslateString.cpp)
add_executable(JZ47 src/nowcoder/offer/dynamic_programming/JZ47_MaxValueOfGifts.cpp)
add_executable(JZ48 src/nowcoder/offer/dynamic_programming/JZ48_LengthOfLongestSubstring.cpp)
add_executable(JZ63 src/nowcoder/offer/dynamic_programming/JZ63_Stock.cpp)
add_executable(JZ70 src/nowcoder/offer/dynamic_programming/JZ70_RectangleCover.cpp)
add_executable(JZ71 src/nowcoder/offer/dynamic_programming/JZ71_JumpFloor2.cpp)
add_executable(JZ85 src/nowcoder/offer/dynamic_programming/JZ85_FindGreatSumOfSubArray2.cpp)
add_executable(JZ6 src/nowcoder/offer/lists/JZ6_PrintListNumberReversely.cpp)
add_executable(JZ18 src/nowcoder/offer/lists/JZ18_DeleteNode.cpp)
add_executable(JZ22 src/nowcoder/offer/lists/JZ22_FindKthNodeReversely.cpp)
add_executable(JZ23 src/nowcoder/offer/lists/JZ23_FindEntryNodeOfRingList.cpp)
add_executable(JZ25 src/nowcoder/offer/lists/JZ25_MergeTwoSortedLists.cpp)
add_executable(JZ24 src/nowcoder/offer/lists/JZ24_ReverseAnList.cpp)
add_executable(JZ35 src/nowcoder/offer/lists/JZ35_CopyComplexList.cpp)
add_executable(JZ52 src/nowcoder/offer/lists/JZ52_CommonNodeOfTwoLists.cpp)
add_executable(JZ76 src/nowcoder/offer/lists/JZ76_DeleteDuplicateNode.cpp)
add_executable(JZ9 src/nowcoder/offer/queue_stack/JZ9_TwoStackImplementQueue.cpp)
add_executable(JZ30 src/nowcoder/offer/queue_stack/JZ30_StackWithMin.cpp)
add_executable(JZ31 src/nowcoder/offer/queue_stack/JZ31_StackPushPopOrder.cpp)
add_executable(JZ73 src/nowcoder/offer/queue_stack/JZ73_ReverseWordSequence.cpp)
add_executable(JZ59 src/nowcoder/offer/queue_stack/JZ59_MaxValueInSlidingWindows.cpp)
add_executable(JZ12 src/nowcoder/offer/traceback/JZ12_MatrixPath.cpp)
add_executable(JZ13 src/nowcoder/offer/traceback/JZ13_RobotMoveRange.cpp)
add_executable(JZ7 src/nowcoder/offer/tree/JZ7_RebuildBinaryTree.cpp)
add_executable(JZ8 src/nowcoder/offer/tree/JZ8_NextNodeOfBinaryTree.cpp)
add_executable(JZ26 src/nowcoder/offer/tree/JZ26_SubStructureOfTree.cpp)
add_executable(JZ27 src/nowcoder/offer/tree/JZ27_MirrorOfBinaryTree.cpp)
add_executable(JZ28 src/nowcoder/offer/tree/JZ28_SymmetricalTree.cpp)
add_executable(JZ32 src/nowcoder/offer/tree/JZ32_PrintTreeFromUpToBottom.cpp)
add_executable(JZ33 src/nowcoder/offer/tree/JZ33_PostorderTraverse.cpp)
add_executable(JZ34 src/nowcoder/offer/tree/JZ34_FindPathOfTree.cpp)
add_executable(JZ36 src/nowcoder/offer/tree/JZ36_ConvertBinarySearchTreeToList.cpp)
add_executable(JZ37 src/nowcoder/offer/tree/JZ37_SerializeAndDeserialize.cpp)
add_executable(JZ54 src/nowcoder/offer/tree/JZ54_KthNodeOfBinarySearchTree.cpp)
add_executable(JZ55 src/nowcoder/offer/tree/JZ55_MaxDepthOfTree.cpp)
add_executable(JZ68 src/nowcoder/offer/tree/JZ68_LowestCommonAncestor.cpp)
add_executable(JZ77 src/nowcoder/offer/tree/JZ77_PrintTree.cpp)
add_executable(JZ78 src/nowcoder/offer/tree/JZ78_PrintTreeBFS.cpp)
add_executable(JZ79 src/nowcoder/offer/tree/JZ79_JudgeBalanceTree.cpp)
add_executable(JZ82 src/nowcoder/offer/tree/JZ82_JudgeDefinedSumOnPathOfTree.cpp)
add_executable(JZ84 src/nowcoder/offer/tree/JZ84_FindPathOfTree3.cpp)
add_executable(JZ86 src/nowcoder/offer/tree/JZ86_LowestCommonAncestor.cpp)

add_executable(temp src/test/temp.cpp)
add_executable(FindKminNumber src/nowcoder/test/FindKminNumber.cpp)
